package com.bob.clan.wxconnector.exception;

import lombok.Data;

/**
 * Created by fs.ge on 2016/12/8.
 */
@Data
public class LoginException extends  Exception {
    private int code;
    private String msg;

    public LoginException(int errCode) {
        this.code = errCode;
        switch (code) {
            case 1000:
                this.msg = "无登有效登录信息";
                break;
            case 1001:
                this.msg = "登录信息不完整,缺少openid";
                break;
            case 1002:
                this.msg = "登录信息不完整,缺少nickname";
                break;
            case 1003:
                this.msg = "登录信息不完整,缺少头像";
                break;
            case 1004:
                this.msg = "登录信息不完整,缺少时间戳";
                break;
            case 1014:
                this.msg = "时间戳格式非法";
                break;
            case 1005:
                this.msg = "登录信息不完整,缺少登录签名";
                break;
            case 2001:
                this.msg = "登录超时，请重新再试";
                break;
            case 3001:
                this.msg = "登录签名不一致，请使用合法渠道登录";
                break;
            case 4001:
                this.msg = "微信已断开，请重试";
                break;
            case 4002:
                this.msg = "未知原因，请联系管理员";
                break;
            case 5001:
                this.msg = "登录二维码已被他人扫过，请勿重复扫码";
                break;
        }
    }
}
